﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public abstract class Audio_Basic : MonoBehaviour
{
    public AudioSource audioSource;
    public List<AudioClip> musics;
    static public int now=0;
    protected int count;
    // Start is called before the first frame update
    void Start()
    {
        //Debug.Log("Music: " + now);
        count = musics.Count;
        audioSource.clip = musics[now];
        audioSource.Play();
    }

    // Update is called once per frame
    void FixedUpdate()
    {
        if (!audioSource.isPlaying)
        {
            onMusicEnd();
        }
    }
    //protected void check_isPlaying()
    //{
        
    //}

    protected abstract void onMusicEnd();
}
